import apiUrl from './base'
import axios from '@/libs/axios'

const user = {
  login({ username, password }) {
    const data = {
      type: 1,
      username,
      password
    }
    return axios.request({
      url: `${apiUrl.base}v1/Login/pc/login`,
      data,
      method: 'post'
    })
  },
  getMenu() {
    return axios.request({
      url: `${apiUrl.base}v1/Login/getMenuAndButton/pc`,
      params: {},
      method: 'post'
    })
  },
  getUserDetail() {
    return axios.request({
      url: `${apiUrl.base}v1/User/details`,
      params: {},
      method: 'post'
    })
  },
  getUserInfo() {
    return axios.request({
      url: `${apiUrl.base}v1/User/details/topRightCorner`,
      params: {},
      method: 'post'
    })
  },
  editRightCorner(data) {
    return axios.post(`${apiUrl.base}v1/User/edit/topRightCorner`, data)
  },
  // 数据字典
  dictTypeCode(code) {
    return axios.get(`${apiUrl.base}v1/Dict/getListByTypeCode/${code}`, '')
  },
  resetPass(data) {
    return axios.post(`${apiUrl.base}v1/Login/reset`, data)
  },
  logoutRecord() {
    return axios.get(`${apiUrl.base}v1/Login/logoutPc`, '')
  }
}
export default user
